<h2><?= $this->translate('Listing messages');?></h2>
<div class="grid_12"><?= $this->flashMessenger(); ?></div>
<div class="clear"></div>

<div class="grid_12 alpha omega">
	<table width="100%">
		<thead>
			<tr>
				<th><?php echo $this->translate('Date'); ?></th>
				<th><?php echo $this->translate('Email'); ?></th>
				<th><?php echo $this->translate('Message'); ?></th>
				<th><?php echo $this->translate('Read'); ?></th>
				<th><?php echo $this->translate('Actions'); ?></th>
			</tr>
		</thead>
		<tbody>
			<?php if($this->listing->count() > 0): ?>
				<?php foreach ($this->listing as $message): ?>
					<tr>
						<td><?= $this->Getdate($message->created_at); ?></td>
						<td><?= $message->email; ?></td>
						<td>
							<a href="<?= $this->url(array('id' => $message->id), 'default_feedback_show'); ?>" title="<?= $this->translate('Read message');?>">
								<?= substr($message->message, 0, 150) . '...'; ?>
							</a>		
						</td>
						<td><?= $this->IconPublished($message->is_read); ?></td>
						<td align="center">
							<a href="<?php echo $this->url(array('id' => $message->id), 'default_feedback_delete'); ?>" onclick="return confirm('<?php echo $this->translate('Are you sure?'); ?>');">
								<?php echo $this->translate('Delete'); ?>
							</a>
						</td>
					</tr>
				<?php endforeach; ?>
			<?php else: ?>
				<tr>
					<td colspan="3">
						<?php echo $this->translate('No item messages'); ?>
					</td>
				</tr>
			<?php endif; ?>
		</tbody>
	</table>
</div>